class LoginPage {
  mockApi() {
    cy.intercept('POST', '/api/login/account', {fixture: 'login.json'})
    cy.intercept('GET', 'api/currentUser', {fixture: 'currentUser.json'})
  }

  visit() {
    cy.visit('/user/login');
  }

  fillUserName(value) {
    cy.get('#username').type(value);
    return this;
  }

  fillPassword(value) {
    cy.get(`[id=password]`).type(value);

    return this;
  }

  submit() {
    cy.get('.ant-btn-primary').click();
  }

  getRedirectUrl() {
    return cy.url();
  }

}

export default LoginPage;
